# Jexter Configuration - Get Total Pages ## Using Jexter to Extract the Total Number of Pages in `totalpage_step` **Description:** In the `totalpage_step`, Jexter is utilized to extract the total number of pages from a webpage, which is essential for planning the entire data extraction task. Here are several examples of using Jexter to extract this information, each tailored to different HTML structures. ### Example 1: Directly Locating Pagination Links **HTML Structure:** ```html ``` **Jexter Configuration:** ```json { "elements": { "TotalPageNum": "//div[@class='pagination']//a[5]" } } ``` **Explanation:** This configuration directly targets the last link in the pagination navigation, which usually points to the last page. By using the XPath expression `//div[@class='pagination']//a[5]`, we can directly obtain the text content of this link, which typically contains information about the total number of pages. ### Example 2: Extracting from Pagination Button Text **HTML Structure:** ```html ``` **Jexter Configuration:** ```json { "elements": { "TotalPageNum": "//div[@class='pagination']/span[@class='page-info']" } } ``` **Explanation:** In this configuration, we locate the `` tag containing pagination information through an XPath selector. This tag usually contains the current page number and the total number of pages. Through this configuration, we can directly extract the total number of pages. ### Example 3: Extracting from Pagination Script in Static Examples **HTML Structure:** ```html ``` **Jexter Configuration:** ```json { "elements": { "TotalPageNum": "//div[@class='pagination']/script" } } ``` **Explanation:** In this static example, the pagination information is dynamically generated through a JavaScript script. The Jexter configuration obtains this information by selecting the `